home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Surfer: Getting Started
/
Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin
/
pc
/
mac
/
bonus
/
peter_le
/
finger-1
/
my_units
/
myhandle.uni
< prev
next >
Wrap
Text File
|
1992-02-24
|
1KB
|
60 lines
unit MyHandleQuitBoth;
{ This code is part of the Finger/Fingerd source code, written in THINK Pascal 4 }
{ Copyright 1991-1992 Peter N Lewis }
{ If you use this code, you must give me credit in your about box and documentation }
{ This is part of my generic library of routines }
interface
procedure InitQuitBoth (creator: OSType);
procedure FinishQuitBoth;
implementation
uses
BaseGlobals, MySystem7, MyFMenus, AppGlobals;
var
quitBoth: boolean;
creatorType: OSType;
procedure DoQuit;
begin
quitNow := true;
if quitBoth then
QuitApplication(creatorType);
end;
procedure SetQuit (themenu, theitem: integer);
var
dummyb: boolean;
er: eventRecord;
nqb: boolean;
process: processSerialNumber;
s: str255;
begin
dummyb := GetOSEvent(0, er);
nqb := (BAND(er.modifiers, optionKey) <> 0) & GetPSN(creatorType, process);
if nqb <> quitBoth then begin
quitBoth := nqb;
if quitBoth then
GetIndString(s, quitBothStrhID, quitBothQuitBothStrhIndex)
else
GetIndString(s, quitBothStrhID, quitBothQuitStrhIndex);
SetItem(GetMHandle(themenu), theitem, s);
end;
end;
procedure InitQuitBoth (creator: OSType);
begin
quitBoth := false;
creatorType := creator;
SetFBoth(CQuit, @DoQuit, @SetQuit);
end;
procedure FinishQuitBoth;
begin
end;
end.